package com.blankii.androidlibrary.init

import androidx.navigation.findNavController
import com.blankii.androidlibrary.R
import com.blankii.androidlibrary.base.BaseBindingActivity
import com.blankii.androidlibrary.databinding.ActivityLibraryMainBinding
import com.blankii.androidlibrary.exts.loge

/**
 * 开放界面总入口
 */
class LibraryMainActivity() :
    BaseBindingActivity<ActivityLibraryMainBinding>(ActivityLibraryMainBinding::inflate) {

    override fun onInitView() {

    }

    override fun onInitData() {
        findNavController(R.id.libraryNavHost).addOnDestinationChangedListener { controller, destination, arguments ->
            when (destination.id) {
                R.id.indexFragment -> {
                    "我是indexFragment".loge(TAG)
                }

                R.id.infoFragment -> {
                    "我是infoFragment".loge(TAG)
                }

                R.id.autoSizeFragment -> {
                    "我是autoSizeFragment".loge(TAG)
                }

                else -> {
                    "我是 else${destination.id}".loge(TAG)
                }
            }
        }
    }
}